package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.system.domain.Factor;
import com.ruoyi.system.domain.FactorCategory;
import com.ruoyi.system.domain.FactorItem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.StrategyBuilderMapper;
import com.ruoyi.system.domain.StrategyBuilder;
import com.ruoyi.system.service.IStrategyBuilderService;

/**
 * 策略生成器Service业务层处理
 *
 * @author ruoyi
 * @date 2022-01-25
 */
@Service
public class StrategyBuilderServiceImpl implements IStrategyBuilderService
{
    @Autowired
    private StrategyBuilderMapper strategyBuilderMapper;

    /**
     * 查询策略生成器
     *
     * @param factorCategoryId 策略生成器主键
     * @return 策略生成器
     */
    @Override
    public StrategyBuilder selectStrategyBuilderByFactorCategoryId(String factorCategoryId)
    {
        return strategyBuilderMapper.selectStrategyBuilderByFactorCategoryId(factorCategoryId);
    }

    /**
     * 查询策略生成器列表
     *
     * @param strategyBuilder 策略生成器
     * @return 策略生成器
     */
    @Override
    public List<StrategyBuilder> selectStrategyBuilderList(StrategyBuilder strategyBuilder)
    {
        return strategyBuilderMapper.selectStrategyBuilderList(strategyBuilder);
    }

    /**
     * 查询因子列表
     *
     * @param strategyBuilder 因子
     * @return 因子集合
     */
    @Override
    public List<FactorItem> selectFactorItemList(StrategyBuilder strategyBuilder) {
        return strategyBuilderMapper.selectFactorItemList(strategyBuilder);
    }

    /**
     * 新增策略生成器
     *
     * @param strategyBuilder 策略生成器
     * @return 结果
     */
    @Override
    public int insertStrategyBuilder(StrategyBuilder strategyBuilder)
    {
        return strategyBuilderMapper.insertStrategyBuilder(strategyBuilder);
    }

    /**
     * 修改策略生成器
     *
     * @param strategyBuilder 策略生成器
     * @return 结果
     */
    @Override
    public int updateStrategyBuilder(StrategyBuilder strategyBuilder)
    {
        return strategyBuilderMapper.updateStrategyBuilder(strategyBuilder);
    }

    /**
     * 批量删除策略生成器
     *
     * @param factorCategoryIds 需要删除的策略生成器主键
     * @return 结果
     */
    @Override
    public int deleteStrategyBuilderByFactorCategoryIds(String[] factorCategoryIds)
    {
        return strategyBuilderMapper.deleteStrategyBuilderByFactorCategoryIds(factorCategoryIds);
    }

    /**
     * 删除策略生成器信息
     *
     * @param factorCategoryId 策略生成器主键
     * @return 结果
     */
    @Override
    public int deleteStrategyBuilderByFactorCategoryId(String factorCategoryId)
    {
        return strategyBuilderMapper.deleteStrategyBuilderByFactorCategoryId(factorCategoryId);
    }
}
